package com.example.srm.common.exception;

import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * @author pfk
 * @creatTime 2022/01/20 15:42
 * @describe 全局异常
 */
@Component
@Data
public class MyException extends RuntimeException {
    /**
     * 异常信息
     */
    private String msg;
    /**
     * 异常状态码
     */
    private int code;

    public MyException(){}

    public MyException(String msg,int code){
        super(msg);
        this.msg = msg;
        this.code = code;
    }

}
